<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /**
       * @param {number[]} nums
       * @return {number[]}
       */
      var smallerNumbersThanCurrent = function (nums) {
        let res = [];
        for (let i = 0; i < nums.length; i++) {
          let count = 0;
          for (let j = 0; j < nums.length; j++) {
            if (nums[i] > nums[j]) {
              count += 1;
            }
          }
          res.push(count);
        }
        return res;
      };
    </script>
  </body>
</html>
